package com.cnswhy.cloud.server.core.entity;


import com.baomidou.mybatisplus.annotation.TableId;
import com.cnswhy.cloud.common.core.exception.BizException;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.io.Serializable;

@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Builder
public class BaseEntity implements Serializable, Cloneable {
    protected String version ;
    protected String method ;
    protected String productId ;
    protected String accessType ;
    protected String mid ;
    protected String plMid ;
    protected String channelType ;
    protected String reqTime ;

    /**
     *
     * @return
     */
    @Override
    public Object clone() {
        //支持克隆  提高性能  仅仅是浅克隆
        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            return new BizException("克隆失败");
        }
    }

    /**
     * 保存和缺省验证组
     */
    public interface Save extends Default {

    }

    /**
     * 更新和缺省验证组
     */
    public interface Update extends Default {

    }
}
